package com.team1.supervend.state_machine;

public class AcceptingMoneyForPaymentState implements State {
 
    SuperVend superVend;
    private float Amount = 0.0f;
 
    public AcceptingMoneyForPaymentState(SuperVend superVend) {
        this.superVend = superVend;
    }
       
	@Override
	public void startSale() {
		System.out.println("startSale                   -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void cancelSale() {
		System.out.println("cancelSale                  -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void endSale() {
		System.out.println("endSale                     -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void returnToIdle() {
		System.out.println("returnToIdle                -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void preValidatePayment() {
		System.out.println("preValidatePayment          -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void payBalance() {
		System.out.println("payBalance                  -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void cancelPayment() {
		System.out.println("cancelPayment               -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void chooseCashPayment() {
		System.out.println("chooseCashPayment           -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void insertMoney(float denomination) {
		System.out.println("insertMoney($"+ denomination+")" );
	    Amount = Amount + denomination;
	}

	@Override
	public void makeCashPayment() {
		System.out.println("makeCashPayment");
		if ( Amount > 0.01 ) { 
		   superVend.setState(superVend.getProcessingSaleState());
		}
	}

	@Override
	public void supplyCreditCardInformation() {
		System.out.println("supplyCreditCardInformation -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void paymentAuthorized() {
		System.out.println("paymentAuthorized           -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void allowProductSelection() {
		System.out.println("allowProductSelection       -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void chooseProduct(int quantity) {
		System.out.println("chooseProduct               -- AcceptingMoneyForPaymentState -- do nothing");
	}

	@Override
	public void productSelectionComplete() {
		System.out.println("productSelectionComplete    -- AcceptingMoneyForPaymentState -- do nothing");
	}
 
	public String toString() {
		return "AcceptingMoneyForPaymentState";
	}
}


